﻿
using System.Collections.Generic;
using Kratos.Framework.Configurations;

namespace Kratos.Framework.Infrastructures
{
    /// <summary>
    /// 存储加载的modeule
    /// </summary>
    public interface IModulesLoaded
    {
        /// <summary>
        ///  返回module的实例
        /// </summary>
        IKratosModule Load(KratosConfigurationSection config, KratosModuleConfigurationElement module);

        /// <summary>
        /// 获取所有加载的模块实例
        /// </summary>
        /// <returns></returns>
        IEnumerable<IKratosModule> GetModules();

        /// <summary>
        /// 获取所有加载的模块实例
        /// </summary>
        /// <returns></returns>
        IEnumerable<T> GetModules<T>() where T : IKratosModule;

        /// <summary>
        /// 卸载所有加载的模块
        /// </summary>
        void UnloadModules();
    }
}
